// Icon

PANEL = {}
function PANEL:EnableClick( callback )
	self.IsButton = true
	local pn = vgui.Create( "DButton" )
	pn:SetParent( self )
	pn:SetPos( 0, 0 )
	pn:SetSize( self:GetWide(), self:GetTall() )
	pn:SetText( "" )
	pn.Paint = function( self )
		self:GetParent():Paint( true )
	end
	pn.DoClick = callback
	self.Clicker = pn
end
function PANEL:SetIcon( icon )
	self.Icon = surface.GetTextureID( "vgui/" .. icon )
end
function PANEL:Paint( btn )
	if ((self.IsButton) && (!btn)) then return end
	surface.SetDrawColor( 255, 255, 255, 255 )
	surface.SetTexture( self.Icon )
	surface.DrawTexturedRect( 0, 0, self:GetWide(), self:GetTall() )
end
vgui.Register( "Icon", PANEL, "PANEL" )